import Vue from 'vue';
import Vuex from 'vuex';
// 引入小仓库
import home from "./Home/index"
import search from "./Search/index"
import detail from './Detail/index'
import ShopCart from './ShopCart/index'
import User from './User/index'
import Trade from './Trade/index'

Vue.use(Vuex);


// getters:理解为计算属性，由于简化仓库数据，让组件获取仓库得数据更加方便

// 创建并暴露store
export default new Vuex.Store({
    // 实现vuex仓库模块式开发存储数据
    modules: {
        home,
        search,
        detail,
        ShopCart,
        User,
        Trade
    }
});